Skip to content

Docs for https://github.com/pgdogdev/pgdog/pull/1502 - #111

Merged
jkaczman merged 1 commit into
mainfrom
jk-force-reload-command
Sep 9, 2026
Merged

Docs for https://github.com/pgdogdev/pgdog/pull/1502#111
jkaczman merged 1 commit into
mainfrom
jk-force-reload-command

Conversation

@jkaczman

@jkaczman jkaczman commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pgdog-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b468c60
Status: ✅  Deploy successful!
Preview URL: https://67a5590f.pgdog-docs.pages.dev
Branch Preview URL: https://jk-force-reload-command.pgdog-docs.pages.dev

View logs

@levkk levkk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

jkaczman added a commit to pgdogdev/pgdog that referenced this pull request Sep 9, 2026
Adds an admin `FORCE_RELOAD` command, which acts as a normal `RELOAD` plus guarantees all in-flight transactions are terminated prior to the command's conclusion (and subsequent transactions are sent to the new
`Pool`s).

Uses `CancellationToken` to handle cancellation requests (from `FORCE_RELOAD`) to terminate connections. In addition to the termination logic that evicts `Clients`, it also cancels queries that are running on Postgres using `Server::cancel`. Uses a child token to prevent multiple `Clients` having contention on the `Cluster`'s `CancellationToken` when cloning. This was changed when benchmarking from a clone (reducing overhead by 80%).

When evicted, Clients receive the standard Postgres admin termination error.

These cases are all tested in the integration test `rust/admin_reload.rs`, where it tests (1) termination in an idle transaction, (2) termination in an ongoing query (pg_sleep), (3) checking that the ongoing query is no longer running on Postgres.

PR for documentation of this command: pgdogdev/docs#111
Fixes #1472.
@jkaczman
jkaczman merged commit 259baf3 into main Sep 9, 2026
2 checks passed
@jkaczman
jkaczman deleted the jk-force-reload-command branch September 9, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants